package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PrescriptionMapper;
import com.ruoyi.system.domain.Prescription;
import com.ruoyi.system.service.IPrescriptionService;

/**
 * 处方信息Service业务层处理
 * 
 * @author 墨白
 * @date 2024-08-10
 */
@Service
public class PrescriptionServiceImpl implements IPrescriptionService 
{
    @Autowired
    private PrescriptionMapper prescriptionMapper;

    /**
     * 查询处方信息
     * 
     * @param prescriptionId 处方信息主键
     * @return 处方信息
     */
    @Override
    public Prescription selectPrescriptionByPrescriptionId(Long prescriptionId)
    {
        return prescriptionMapper.selectPrescriptionByPrescriptionId(prescriptionId);
    }

    /**
     * 查询处方信息列表
     * 
     * @param prescription 处方信息
     * @return 处方信息
     */
    @Override
    public List<Prescription> selectPrescriptionList(Prescription prescription)
    {
        return prescriptionMapper.selectPrescriptionList(prescription);
    }

    /**
     * 新增处方信息
     * 
     * @param prescription 处方信息
     * @return 结果
     */
    @Override
    public int insertPrescription(Prescription prescription)
    {
        return prescriptionMapper.insertPrescription(prescription);
    }

    /**
     * 修改处方信息
     * 
     * @param prescription 处方信息
     * @return 结果
     */
    @Override
    public int updatePrescription(Prescription prescription)
    {
        return prescriptionMapper.updatePrescription(prescription);
    }

    /**
     * 批量删除处方信息
     * 
     * @param prescriptionIds 需要删除的处方信息主键
     * @return 结果
     */
    @Override
    public int deletePrescriptionByPrescriptionIds(Long[] prescriptionIds)
    {
        return prescriptionMapper.deletePrescriptionByPrescriptionIds(prescriptionIds);
    }

    /**
     * 删除处方信息信息
     * 
     * @param prescriptionId 处方信息主键
     * @return 结果
     */
    @Override
    public int deletePrescriptionByPrescriptionId(Long prescriptionId)
    {
        return prescriptionMapper.deletePrescriptionByPrescriptionId(prescriptionId);
    }
}
